import Vue from 'vue'
import VueRouter from 'vue-router'
// import store from '@/store'

Vue.use(VueRouter)

// 配置路由
const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: () => import('@/views/login/LoginIndex') },
    { path: '/find', component: () => import('@/views/login/Find') },
    {
      path: '/adminIndex',
      redirect: '/admin',
      component: () => import('@/layout/LayoutContainer'),
      children: [
        { path: '/admin', component: () => import('@/views/admin/index') },
        { path: '/info/viewAdminInfo', component: () => import('@/views/admin/info/ViewInfo') },
        { path: '/manage/importUser', component: () => import('@/views/admin/manage/ImportUser') },
        { path: '/manage/viewUser', component: () => import('@/views/admin/manage/ViewUser') },
        { path: '/college/importCollege', component: () => import('@/views/admin/college/ImportCollege') },
        { path: '/college/viewCollege', component: () => import('@/views/admin/college/ViewCollege') },
        { path: '/college/viewMajor', component: () => import('@/views/admin/college/ViewMajor') }
      ]
    },
    {
      path: '/teacherIndex',
      redirect: '/teacher',
      component: () => import('@/layout/LayoutContainer'),
      children: [
        { path: '/teacher', component: () => import('@/views/teacher/index') },
        { path: '/info/viewTeacherInfo', component: () => import('@/views/teacher/info/ViewInfo') }
      ]
    },
    {
      path: '/studentIndex',
      redirect: '/student',
      component: () => import('@/layout/LayoutContainer'),
      children: [
        { path: '/student', component: () => import('@/views/student/index') },
        { path: '/info/viewStudentInfo', component: () => import('@/views/student/info/ViewInfo') }
      ]
    },
    { path: '/404', component: () => import('@/views/404') }
  ]
})

export default router
